<?php

require 'defines.php';
require 'configs.php';

global $sourceDirs;
$sourceDirs = array("core/","core/contextproviders/","core/fileinfoplugins/");

function __autoload($class)
{
    global $sourceDirs;

    $filename = "class".strtolower($class).".php";

    foreach($sourceDirs as $dir)
    {
        if(file_exists($dir.$filename)){
            require $dir.$filename;
            return true;
        }
    }
    return false;
}

require "core/class.errorhandler.php";
require "core/class.factory.php";
require "core/class.files.php";
require "core/class.fipmanager.php";

require "core/contextproviders/class.server.php";
require "core/contextproviders/class.get.php";
require "core/contextproviders/class.post.php";
require "core/contextproviders/class.cookies.php";
require "core/contextproviders/class.session.php";
require "core/contextproviders/class.uploadedfiles.php";

require "core/class.context.php";
require "core/class.form.php";


require "core/class.route.php";
require "core/class.user.php";
require "core/class.renderer.php";
require "core/class.site.php";

?>
